package observer.practice_02;

import java.util.Observable;

/**
 * @author yi qiang
 * @date 2021/6/17 0:22
 */
public class NewsAgency extends Observable {

    private String news;

    public void updateNews(String news){
        this.news=news;
        change();
    }

    public void change(){
        setChanged();
        notifyObservers();
    }

    public String getNews() {
        return news;
    }
}
